Skip to content

Conversation

brendandahl
Copy link
Collaborator

@brendandahl brendandahl commented Jul 31, 2025

After #24175, pointer policies were required in more places, but there
was no way to pass the policy into val's call, operator(), and new_
methods and use pointers.

All of these methods take variadic template arguments already
which made passing separate variadic policy arguments challenging. I used
some C++14/17 tricks to separate the regular arguments and policy
arguments.

Fixes #24398

@brendandahl brendandahl requested review from sbc100 and RReverser July 31, 2025 23:25
@brendandahl
Copy link
Collaborator Author

reviewer: The first commit is just moving policy code into wire.h, so it's probably easier to look at the second commit on its own.

@brendandahl
Copy link
Collaborator Author

brendandahl commented Sep 3, 2025

@sbc or @RReverser mind taking a look? The changes ignorning the moved code are relatively small 01eafbe

@sbc100
Copy link
Collaborator

sbc100 commented Sep 3, 2025

So does this mean some code now will not work of behave differently under C++11 vs C++17?

I wonder if we should document this or mention in the changelog?

using Policy = WithPolicies<FilterTypes<isPolicy, Args...>>;
auto filteredArgs = Filter<isNotPolicy>(args...);
return std::apply(
[&](auto&&... filteredArgs) -> decltype(auto) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we name filteredArgs differently here so it doesn't shadow the outer filteredArgs 2 lines up?

…w_`.

After emscripten-core#24175, pointer policies were required in more places, but there
was no way to pass the policy into val's `call`, `operator()`, and `new_`
methods and use pointers.

All of these methods take variadic template arguments already
which made passing separate variadic policy arguments challenging. I used
some C++14/17 tricks to separate the regular arguments and policy
arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot compile projects with emsdk 4.0.9
2 participants